﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraReports.UI;
using System.Configuration;


namespace IB_report_stand.Dialog
{
    public partial class dlg_sale_diary : DevExpress.XtraEditors.XtraForm
    {
        public dlg_sale_diary()
        {
            InitializeComponent();
           
        }

        private void btnReport_Click(object sender, EventArgs e)
        {

            String reckNum1 = txtGlAccount1.Text;
            String reckNum2 = txtGlAccount2.Text;
            String reckNum3 = txtGlAccount3.Text;
            String reckNum4 = txtGlAccount4.Text;
            String reckNum5 = txtGlAccount5.Text;
            String reckNum6 = txtGlAccount6.Text;
            String reckNum7 = txtGlAccount7.Text;
            String acc1 = txtJournalNum1.Text;
            String acc2 = txtJournalNum2.Text;

            DateTime startDte = dteStart.DateTime;
            DateTime endDte = dteEnd.DateTime;

            

            //rpt_sale_diary report = new rpt_sale_diary( RekNum1 = reckNum1, RekNum2 = reckNum2, RekNum3 = reckNum3, RekNum4 = reckNum4, RekNum5 = reckNum5, RekNum6 = reckNum6, RekNum7 = reckNum7, Account1 = acc1, Account2 = acc2, StartDate = startDte, EndDate = endDte };
            rpt_sale_diary report = new rpt_sale_diary(reckNum1, reckNum2, reckNum3, reckNum4, reckNum5, reckNum6, reckNum7, acc1, acc2, startDte, endDte);
            ReportPrintTool tool = new ReportPrintTool(report);
            tool.ShowPreview();
            this.Close();


        }

        private void dlg_sale_diary_Load(object sender, EventArgs e)
        {

        }

        private void chkGlAccount4_CheckedChanged(object sender, EventArgs e)
        {
            if (chkGlAccount4.Checked)
            {
                txtGlAccount4.Enabled = true;
            }
            else {
                txtGlAccount4.Enabled = false;
            }
        }

        private void chkGlAccount5_CheckedChanged(object sender, EventArgs e)
        {
            if (chkGlAccount5.Checked)
            {
                txtGlAccount5.Enabled = true;
            }
            else
            {
                txtGlAccount5.Enabled = false;
            }
        }

        private void chkGlAccount6_CheckedChanged(object sender, EventArgs e)
        {
            if (chkGlAccount6.Checked)
            {
                txtGlAccount6.Enabled = true;
            }
            else
            {
                txtGlAccount6.Enabled = false;
            }
        }

        private void chkGlAccount7_CheckedChanged(object sender, EventArgs e)
        {
            if (chkGlAccount7.Checked)
            {
                txtGlAccount7.Enabled = true;
            }
            else
            {
                txtGlAccount7.Enabled = false;
            }
        }

        private void txtJournalNum2_EditValueChanged(object sender, EventArgs e)
        {

        }

      

       

        
    }
}